package pers.cz.javacvdemo.service;

import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import pers.cz.javacvdemo.oss.service.FileTemplate;

/**
 * @version 1.0
 * @description:
 * @author: ChengZhi 0336
 * @create: 2025-08-13 16:16
 **/
@Service
@RequiredArgsConstructor
public class SysFileService {

	private final FileTemplate fileTemplate;
	public void uploadFile(MultipartFile file) throws Exception {
		fileTemplate.putObject("study", file.getOriginalFilename(), file.getInputStream());
	}

	public void uploadFile(String bucketName, MultipartFile file) throws Exception {
		fileTemplate.putObject(bucketName, file.getOriginalFilename(), file.getInputStream());
	}

}
